begin vi. (began; begun; beginning) 1.开始 (opp. end); 着手,动手。 2.始于,源于 (from). School begins on Monday. 星期一开课。 vt. 1.开始,创始;动手,着手。 2.创建。 It has begun to be done. = It has been begun. 工作开始了。 He began (to speak). 他开口了。 a book I began (to read) 开始读的书。 begin a dynasty 开创一个朝代。 begin again 重做,从头另做。 begin at 从…开始 (begin at the wrong end 开错了头。 begin at page 10 从第10页开始)。 begin by (doing ...)从(做…)开始,先做…。 begin on [upon] 着手,动手 (He has begun on a new book. 他已开始读[写]另一本新书)。 begin the world 开始为人[处世];开始独立生活。 begin with 从…开始,先做 (A little caviar to begin with, madame 先吃一点鱼子酱怎么样,女士?)。 not begin to (do) 〔口语〕决不会,完全不 (It does not begin to meet the specifications. 这完全不合规格。 I can't begin to tell you how grateful I am. 我不知道怎样感激你才好)。 to begin with 首先,第一,第一个理由是;本来〔插入语〕 (To begin with, he is too young. 首先[第一],他太年轻了)。
In the begin block , we initialize our integer variable 在begin块中,将整数变量
We used a begin block in the previous example 程序输出如下,这正是我们所期望的:
In pl 1 , a begin block or procedure block 1语言中的开始块或过程块。
For such situations , awk allows you to define a begin block 这意味着如果希望任何文本从新的一行开始,那么需要明确写入
We ll start off with the first line , the begin block and a function definition 我们将从第一行( begin块和函数定义)开始:
Begin blocks , for instance , will be executed first but can be specified many times throughout the program 例如, begin语句块会被首先执行,但它可以在程序中多次说明。
The remaining lines define our begin block , which gets executed before awk starts processing our checkbook file 其余行定义了begin块,在awk开始处理支票簿文件之前将执行这个代码块。
Because the begin block is evaluated before awk starts processing the input file , it s an excellent place to initialize the fs field separator variable , print a heading , or initialize other global variables that you ll reference later in the program Awk还有" do . while "循环,它在代码块结尾处对条件求值,而不象标准while循环那样在开始处求值。它类似于其它语言中的" repeat . until "循环。